#pragma once

#ifndef CONTROLPANELCLASS_H
#define CONTROLPANELCLASS_H
#include "Bounce2.h"
#include "serlcd.h"
#include "PanelMenuBase.h"
#include "HomeScreenClass.h"

class ControlPanelClass
{
public:
	ControlPanelClass(void);
	
	~ControlPanelClass(void);


	

	void setup();
	void update();
	PanelMenuBaseClass * GetActiveScreen();
	void SetActiveScreen(PanelMenuBaseClass * screen);

	
	bool isReady;

	bool EnterButtonPressed();
	
	bool MenuButtonPressed();
	bool LeftButtonPressed();
	bool RightButtonPressed();
	bool DownButtonPressed();
	bool UpButtonPressed();

	serLCD LCD;

	 Bounce LeftButton = Bounce();
	 Bounce RightButton = Bounce();
	 Bounce UpButton = Bounce();
	 Bounce DownButton = Bounce();
	 Bounce MenuButton = Bounce(); 
	 Bounce EnterButton= Bounce();

private:
	

	
	PanelMenuBaseClass *_ActiveScreen;
	void SetupButton(Bounce bouncer, uint8_t pin);

	//Button state storage
	bool enterButtonPreviousState;
	bool menuButtonPreviousState;
	bool leftButtonPreviousState;
	bool rightButtonPreviousState;
	bool upButtonPreviousState;
	bool downButtonPreviousState;
};

extern ControlPanelClass ControlPanel;

#endif